Optimal. Leaf size=90 \[ \frac {x}{2 b}-\frac {i x^2}{2}+\frac {x \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {i \text {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{2 b^2}-\frac {\tan (a+b x)}{2 b^2}+\frac {x \tan ^2(a+b x)}{2 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 90, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.700, Rules used = {3801, 3554, 8,
3800, 2221, 2317, 2438} \begin {gather*} -\frac {i \text {Li}_2\left (-e^{2 i (a+b x)}\right )}{2 b^2}-\frac {\tan (a+b x)}{2 b^2}+\frac {x \log \left (1+e^{2 i (a+b x)}\right )}{b}+\frac {x \tan ^2(a+b x)}{2 b}+\frac {x}{2 b}-\frac {i x^2}{2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2221
Rule 2317
Rule 2438
Rule 3554
Rule 3800
Rule 3801
Rubi steps
\begin {align*} \int x \tan ^3(a+b x) \, dx &=\frac {x \tan ^2(a+b x)}{2 b}-\frac {\int \tan ^2(a+b x) \, dx}{2 b}-\int x \tan (a+b x) \, dx\\ &=-\frac {i x^2}{2}-\frac {\tan (a+b x)}{2 b^2}+\frac {x \tan ^2(a+b x)}{2 b}+2 i \int \frac {e^{2 i (a+b x)} x}{1+e^{2 i (a+b x)}} \, dx+\frac {\int 1 \, dx}{2 b}\\ &=\frac {x}{2 b}-\frac {i x^2}{2}+\frac {x \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {\tan (a+b x)}{2 b^2}+\frac {x \tan ^2(a+b x)}{2 b}-\frac {\int \log \left (1+e^{2 i (a+b x)}\right ) \, dx}{b}\\ &=\frac {x}{2 b}-\frac {i x^2}{2}+\frac {x \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {\tan (a+b x)}{2 b^2}+\frac {x \tan ^2(a+b x)}{2 b}+\frac {i \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{2 i (a+b x)}\right )}{2 b^2}\\ &=\frac {x}{2 b}-\frac {i x^2}{2}+\frac {x \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {i \text {Li}_2\left (-e^{2 i (a+b x)}\right )}{2 b^2}-\frac {\tan (a+b x)}{2 b^2}+\frac {x \tan ^2(a+b x)}{2 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(210\) vs. \(2(90)=180\).
time = 6.16, size = 210, normalized size = 2.33 \begin {gather*} \frac {x \sec ^2(a+b x)}{2 b}+\frac {\csc (a) \left (b^2 e^{-i \text {ArcTan}(\cot (a))} x^2-\frac {\cot (a) \left (i b x (-\pi -2 \text {ArcTan}(\cot (a)))-\pi \log \left (1+e^{-2 i b x}\right )-2 (b x-\text {ArcTan}(\cot (a))) \log \left (1-e^{2 i (b x-\text {ArcTan}(\cot (a)))}\right )+\pi \log (\cos (b x))-2 \text {ArcTan}(\cot (a)) \log (\sin (b x-\text {ArcTan}(\cot (a))))+i \text {PolyLog}\left (2,e^{2 i (b x-\text {ArcTan}(\cot (a)))}\right )\right )}{\sqrt {1+\cot ^2(a)}}\right ) \sec (a)}{2 b^2 \sqrt {\csc ^2(a) \left (\cos ^2(a)+\sin ^2(a)\right )}}-\frac {\sec (a) \sec (a+b x) \sin (b x)}{2 b^2}-\frac {1}{2} x^2 \tan (a) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.07, size = 122, normalized size = 1.36
method | result | size |
risch | \(-\frac {i x^{2}}{2}+\frac {2 b x \,{\mathrm e}^{2 i \left (b x +a \right )}-i {\mathrm e}^{2 i \left (b x +a \right )}-i}{b^{2} \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )^{2}}-\frac {2 i a x}{b}-\frac {i a^{2}}{b^{2}}+\frac {x \ln \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )}{b}-\frac {i \polylog \left (2, -{\mathrm e}^{2 i \left (b x +a \right )}\right )}{2 b^{2}}+\frac {2 a \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}\) | \(122\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 386 vs. \(2 (71) = 142\).
time = 0.62, size = 386, normalized size = 4.29 \begin {gather*} -\frac {b^{2} x^{2} \cos \left (4 \, b x + 4 \, a\right ) + i \, b^{2} x^{2} \sin \left (4 \, b x + 4 \, a\right ) + b^{2} x^{2} - 2 \, {\left (b x \cos \left (4 \, b x + 4 \, a\right ) + 2 \, b x \cos \left (2 \, b x + 2 \, a\right ) + i \, b x \sin \left (4 \, b x + 4 \, a\right ) + 2 i \, b x \sin \left (2 \, b x + 2 \, a\right ) + b x\right )} \arctan \left (\sin \left (2 \, b x + 2 \, a\right ), \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) + 2 \, {\left (b^{2} x^{2} + 2 i \, b x + 1\right )} \cos \left (2 \, b x + 2 \, a\right ) + {\left (\cos \left (4 \, b x + 4 \, a\right ) + 2 \, \cos \left (2 \, b x + 2 \, a\right ) + i \, \sin \left (4 \, b x + 4 \, a\right ) + 2 i \, \sin \left (2 \, b x + 2 \, a\right ) + 1\right )} {\rm Li}_2\left (-e^{\left (2 i \, b x + 2 i \, a\right )}\right ) - {\left (-i \, b x \cos \left (4 \, b x + 4 \, a\right ) - 2 i \, b x \cos \left (2 \, b x + 2 \, a\right ) + b x \sin \left (4 \, b x + 4 \, a\right ) + 2 \, b x \sin \left (2 \, b x + 2 \, a\right ) - i \, b x\right )} \log \left (\cos \left (2 \, b x + 2 \, a\right )^{2} + \sin \left (2 \, b x + 2 \, a\right )^{2} + 2 \, \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) + 2 \, {\left (i \, b^{2} x^{2} - 2 \, b x + i\right )} \sin \left (2 \, b x + 2 \, a\right ) + 2}{-2 i \, b^{2} \cos \left (4 \, b x + 4 \, a\right ) - 4 i \, b^{2} \cos \left (2 \, b x + 2 \, a\right ) + 2 \, b^{2} \sin \left (4 \, b x + 4 \, a\right ) + 4 \, b^{2} \sin \left (2 \, b x + 2 \, a\right ) - 2 i \, b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 146 vs. \(2 (71) = 142\).
time = 0.38, size = 146, normalized size = 1.62 \begin {gather*} \frac {2 \, b x \tan \left (b x + a\right )^{2} + 2 \, b x \log \left (-\frac {2 \, {\left (i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 \, b x \log \left (-\frac {2 \, {\left (-i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 \, b x + i \, {\rm Li}_2\left (\frac {2 \, {\left (i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) - i \, {\rm Li}_2\left (\frac {2 \, {\left (-i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) - 2 \, \tan \left (b x + a\right )}{4 \, b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int x \tan ^{3}{\left (a + b x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int x\,{\mathrm {tan}\left (a+b\,x\right )}^3 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________